namespace OverStore.Runtime.ObjectRepository.Accessors
{
    /// <summary>
    /// Provide typed abstract access to result regarding to specified instance.
    /// </summary>
    /// <typeparam name="TInstance">The type of the instance.</typeparam>
    /// <typeparam name="TValue">The type of the result.</typeparam>
    public interface ITypedAccessor<TInstance, TValue> : IAccessor
    {
        /// <summary>
        /// Gets the result from specified instance.
        /// </summary>
        /// <param name="instance">The instance.</param>
        /// <returns>Value got from instance.</returns>
        TValue GetValue(TInstance instance);

        /// <summary>
        /// Sets the result to specified instance.
        /// </summary>
        /// <param name="instance">The instance to set result to.</param>
        /// <param name="value">The result for set.</param>
        void SetValue(TInstance instance, TValue value);
    }
}